package com.goalias.controller;

import com.goalias.domain.dto.EmailDto;
import com.goalias.resp.Result;
import com.goalias.service.INoticeService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/ability/notice")
public class NoticeController {

    @Resource
    private INoticeService noticeService;

    @PostMapping("/sendMail")
    public Result notice(@RequestBody @Validated EmailDto emailDto) {
        noticeService.sendMail(emailDto);
        return Result.success();
    }
}
